Hello World,
I have found an interesting problem! I am trying to import a rtf file which contains some simple text (please see the attached file) and a picture using the following code BUT sometimes got the EXCEPTION_ACCESS_VIOLATION error.
Could anyone please tell me, why is it happening? Even I am getting error with the standard rtf importer!
DXL Code:
string strRtfDocName = "C:\\testWithPicture.rtf"
Module theModule = null
string sModuleFullName = "/TestData/TestModule"
//Create a new module
string strErrRes = create(sModuleFullName, "", "", 1, theModule)
if(strErrRes == "")
{
print "Module is created \n"
if (importRTF(strRtfDocName, theModule, false, false) == 0)
{
print "Rtf imported \n"
}
else
{
print "Not imported \n"
}
}
else
{
print "Module is not created \n"
}
Thanks,
Rony
R@ny - Wed Feb 11 17:33:17 EST 2009 |
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? SystemAdmin - Thu Feb 12 07:30:15 EST 2009
I think the 'importRTF' function expects to start importing data into the current object of the passed module. Since the module has just been created, there is no current object. Try creating an object in the module before calling importRTF
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? Tony_Goodman - Thu Feb 12 07:49:43 EST 2009 SystemAdmin - Thu Feb 12 07:30:15 EST 2009
I think the 'importRTF' function expects to start importing data into the current object of the passed module. Since the module has just been created, there is no current object. Try creating an object in the module before calling importRTF
I just imported your file into a brand new module - no problems. I am using DOORS 8.1.0.6.
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? R@ny - Thu Feb 12 09:07:10 EST 2009 Tony_Goodman - Thu Feb 12 07:49:43 EST 2009
I just imported your file into a brand new module - no problems. I am using DOORS 8.1.0.6.
Thank you for replying.
I have created an empty object and then tried the code, still get the same error. :-(
I am using DOORS 8.3.0.1 Build: 83124. Even standard RTF importer gives me the same error.
Looking forward for other ideas...
Regards,
Rony
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? SystemAdmin - Thu Feb 12 09:55:00 EST 2009 R@ny - Thu Feb 12 09:07:10 EST 2009
Thank you for replying.
I have created an empty object and then tried the code, still get the same error. :-(
I am using DOORS 8.3.0.1 Build: 83124. Even standard RTF importer gives me the same error.
Looking forward for other ideas...
Regards,
Rony
I don't have DOORS 8.3 installed, but once I create the /TestData folder and copy your rtf file to "C:\testWithPicture.rtf", the following works for me in both DOORS 8.1.0.8 (build 81119) and DOORS 9.1.0.2 (build 91132):
string strRtfDocName = "C:\\testWithPicture.rtf"
Module theModule = null
string sModuleFullName = "/TestData/TestModule"
//Create a new module
string strErrRes = create(sModuleFullName, "", "", 1, theModule)
if(strErrRes == "")
{
print "Module is created \n"
//Make sure the just created module is 'current'
current = theModule
//Create a new object in the module to receive the import
Object o = create theModule
if (importRTF(strRtfDocName, theModule, false, false) == 0)
{
print "Rtf imported \n"
}
else
{
print "Not imported \n"
}
}
else
{
print "Module is not created \n"
}
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? SystemAdmin - Thu Feb 12 10:03:29 EST 2009 SystemAdmin - Thu Feb 12 09:55:00 EST 2009
I don't have DOORS 8.3 installed, but once I create the /TestData folder and copy your rtf file to "C:\testWithPicture.rtf", the following works for me in both DOORS 8.1.0.8 (build 81119) and DOORS 9.1.0.2 (build 91132):
string strRtfDocName = "C:\\testWithPicture.rtf"
Module theModule = null
string sModuleFullName = "/TestData/TestModule"
//Create a new module
string strErrRes = create(sModuleFullName, "", "", 1, theModule)
if(strErrRes == "")
{
print "Module is created \n"
//Make sure the just created module is 'current'
current = theModule
//Create a new object in the module to receive the import
Object o = create theModule
if (importRTF(strRtfDocName, theModule, false, false) == 0)
{
print "Rtf imported \n"
}
else
{
print "Not imported \n"
}
}
else
{
print "Module is not created \n"
}
Note that the above fails if I run your original script and get the diagnostic error, then delete and purge the created module and then immediately run the version I posted above. Apparently once that error occurs, that DOORS session is hosed. Try starting a new DOORS client session before running the script posted above.
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? SystemAdmin - Thu Feb 12 10:09:56 EST 2009 Tony_Goodman - Thu Feb 12 07:49:43 EST 2009
I just imported your file into a brand new module - no problems. I am using DOORS 8.1.0.6.
Tony,
Just curious, did you try running Rony's unmodified code? Because I get the same error he gets when running that exact script in DOORS 8.1.0.8.
By the way, why don't the code markers work consistently, as in:
Here is some code.
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? Tony_Goodman - Thu Feb 12 10:51:33 EST 2009 SystemAdmin - Thu Feb 12 10:09:56 EST 2009
Tony,
Just curious, did you try running Rony's unmodified code? Because I get the same error he gets when running that exact script in DOORS 8.1.0.8.
By the way, why don't the code markers work consistently, as in:
Here is some code.
Roger,
Yes, I ran Rony's original unmodified code on 8.1.0.6 and it worked without error.
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? SystemAdmin - Thu Feb 12 11:03:51 EST 2009 Tony_Goodman - Thu Feb 12 10:51:33 EST 2009
Roger,
Yes, I ran Rony's original unmodified code on 8.1.0.6 and it worked without error.
Interesting. I wonder if the problem has anything to do with the environment outside of DOORS? I tested on Windows XP Pro/SP3 with Office 2003.
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? R@ny - Thu Feb 12 14:28:19 EST 2009 SystemAdmin - Thu Feb 12 11:03:51 EST 2009
Interesting. I wonder if the problem has anything to do with the environment outside of DOORS? I tested on Windows XP Pro/SP3 with Office 2003.
Dear All,
I have tried the modified code but still getting the error also tried with DOORS 7.1 and the same error. In DOORS 7.1, importRTF has only one function prototype.
In DOORS 8.3, importRTF has two function prototypes which are documented in the DXL help file beside that I have found another importRTF which is bit different - I also used that but the same behaviour.
I wonder, how other people import RTF using dxl which contain picture files! It is interesting that if the picture is converted to embedded OLE then we can import without error.
I am using Word 2007 as well as Open Office in WinXP.
I am still thinking how to solve this situation but I do not know the exact problem :-(.
Greetings for everyone...
Rony
P.S: About this new forum, searching is not working properly not to mention
code
!
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? R@ny - Fri Feb 13 06:12:18 EST 2009 R@ny - Thu Feb 12 14:28:19 EST 2009
Dear All,
I have tried the modified code but still getting the error also tried with DOORS 7.1 and the same error. In DOORS 7.1, importRTF has only one function prototype.
In DOORS 8.3, importRTF has two function prototypes which are documented in the DXL help file beside that I have found another importRTF which is bit different - I also used that but the same behaviour.
I wonder, how other people import RTF using dxl which contain picture files! It is interesting that if the picture is converted to embedded OLE then we can import without error.
I am using Word 2007 as well as Open Office in WinXP.
I am still thinking how to solve this situation but I do not know the exact problem :-(.
Greetings for everyone...
Rony
P.S: About this new forum, searching is not working properly not to mention
code
!
The other importRTF function which I found has the following syntax:
importRTF(string inputfile, Module aModule, Skip styleMapping)
I have included this in my previous reply but it was not showing due to this forum's "Text Markup" system- I used third brackets to wrap the function prototype which it considered an invalid Link: URL!
Greetings,
Rony
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? SystemAdmin - Fri Feb 13 10:29:05 EST 2009 R@ny - Fri Feb 13 06:12:18 EST 2009
The other importRTF function which I found has the following syntax:
importRTF(string inputfile, Module aModule, Skip styleMapping)
I have included this in my previous reply but it was not showing due to this forum's "Text Markup" system- I used third brackets to wrap the function prototype which it considered an invalid Link: URL!
Greetings,
Rony
You might want to take a look at the rtfim.dxl script bundled with DOORS for an example of using that version of the importRTF function. (Look in the lib/dxl/standard/import directory below where DOORS is installed).
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? R@ny - Fri Feb 13 10:38:37 EST 2009 SystemAdmin - Fri Feb 13 10:29:05 EST 2009
You might want to take a look at the rtfim.dxl script bundled with DOORS for an example of using that version of the importRTF function. (Look in the lib/dxl/standard/import directory below where DOORS is installed).
Yes, I have seen that and tried the same way. But I got the same error :-(.
|
|
Re: importRTF causes EXCEPTION_ACCESS_VIOLATION, any idea? SystemAdmin - Fri Feb 13 10:55:07 EST 2009 R@ny - Fri Feb 13 10:38:37 EST 2009
Yes, I have seen that and tried the same way. But I got the same error :-(.
If your DOORS license is still under maintenance, you should open a trouble ticket with DOORS support. Perhaps they have a fix for the problem.
|
|